home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2004 August / The Sunday Times - The Month 2004-08.iso / pc / engine / modules / thumbs_square.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2004-06-24  |  3.3 KB  |  150 lines

  1. function loadImage(mc, node, extrapath)
  2. {
  3.    var _loc3_ = extrapath;
  4.    if(_loc3_ == null)
  5.    {
  6.       _loc3_ = "";
  7.    }
  8.    var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
  9.    var _loc1_ = node.firstChild.nodeValue;
  10.    var _loc2_ = node.attributes.path;
  11.    if(_loc2_ != null)
  12.    {
  13.       _loc1_ = _loc2_ + _loc1_;
  14.    }
  15.    else
  16.    {
  17.       _loc1_ = strDefaultPath + _loc3_ + _loc1_;
  18.    }
  19.    if(strPathPrefix == null)
  20.    {
  21.       strPathPrefix = "";
  22.    }
  23.    mc.loadMovie(strPathPrefix + _loc1_);
  24. }
  25. function addLink(mc)
  26. {
  27.    Links[mc.link] = mc;
  28. }
  29. function getMCfromLink(Item)
  30. {
  31.    var _loc1_ = Item;
  32.    if(Links[_loc1_] == null)
  33.    {
  34.       var _loc2_ = [];
  35.       while(_loc1_ != sideMenu.ItemHome)
  36.       {
  37.          _loc2_.unshift(_loc1_._name.split("_").pop());
  38.          _loc1_ = _loc1_._parent._parent;
  39.       }
  40.       var _loc3_ = _loc2_.join("/");
  41.       Links[_loc1_] = Links[_loc3_];
  42.    }
  43.    return Links[_loc1_];
  44. }
  45. function removeLinkListener()
  46. {
  47.    Tardis.sideMenu.EB.removeListener(this);
  48. }
  49. function testEnabled(num)
  50. {
  51.    if(num >= nodeData.childNodes.length)
  52.    {
  53.       this["mc_txt_" + num].btn.enabled = false;
  54.    }
  55. }
  56. function txtOver(mc)
  57. {
  58.    var _loc1_ = mc;
  59.    _loc1_.gotoAndStop("over");
  60.    temp.text = "num = " + _loc1_.num;
  61.    _parent.preview.doOver(_loc1_.num);
  62.    Tardis.sideMenu.doOver(_loc1_.link);
  63. }
  64. function txtOut(mc)
  65. {
  66.    var _loc1_ = mc;
  67.    _loc1_.gotoAndStop("off");
  68.    _parent.preview.doOut(_loc1_.num);
  69.    Tardis.sideMenu.doOut(_loc1_.link);
  70. }
  71. function txtUp(mc)
  72. {
  73.    Tardis.sideMenu.doUp(mc.link);
  74. }
  75. function init()
  76. {
  77.    var _loc2_ = Tardis.ActiveSection.id;
  78.    var _loc1_ = Tardis.Colors;
  79.    var strColor = _loc1_.getString(_loc2_);
  80.    SECTION_COLOR = _loc1_.getHex(_loc2_);
  81.    DEFAULT_COLOR = _loc1_.getHex("default");
  82.    DEFAULT_COLOR50 = _loc1_.getHex("default50");
  83.    THUMB_PATH = nodeData.attributes.thumbpath;
  84.    play();
  85. }
  86. function clipInit(clip)
  87. {
  88.    var _loc2_ = clip;
  89.    num = _loc2_._name.split("_")[2];
  90.    var _loc1_ = nodeData.childNodes[num];
  91.    if(_loc1_ != null)
  92.    {
  93.       _loc2_.link = _loc1_.attributes.link;
  94.       FONT_SIZE = _loc1_.attributes.fontsize;
  95.       _loc2_.titleFF.htmlText = "<FONT SIZE=\"" + FONT_SIZE + "\" COLOR=\"" + DEFAULT_COLOR + "\">" + _loc1_.byName("title").getText() + " </FONT>";
  96.    }
  97. }
  98. function doOver(num)
  99. {
  100.    var _loc1_ = this["mc_txt_" + num];
  101.    _loc1_.gotoAndStop("over");
  102.    _parent.preview.doOver(_loc1_.num);
  103. }
  104. function doOut(num)
  105. {
  106.    var _loc1_ = this["mc_txt_" + num];
  107.    _loc1_.gotoAndStop("off");
  108.    _parent.preview.doOut(_loc1_.num);
  109. }
  110. function doPlaylistTrackHilite(mcToHilite, mcToLolite)
  111. {
  112.    var _loc1_ = mcToHilite;
  113.    var _loc2_ = mcToLolite;
  114.    if(_loc1_ == null)
  115.    {
  116.       _loc1_ = hiliteMc;
  117.       if(loliteMc != null)
  118.       {
  119.          _loc2_ = loliteMc;
  120.       }
  121.    }
  122.    else
  123.    {
  124.       hiliteMc = _loc1_;
  125.       loliteMc = _loc2_;
  126.    }
  127.    if(_loc2_)
  128.    {
  129.       _loc2_.trackPlaying = false;
  130.       txtOut(_loc2_);
  131.    }
  132.    if(_loc1_)
  133.    {
  134.       _loc1_.trackPlaying = true;
  135.       txtOver(_loc1_);
  136.    }
  137. }
  138. blnHasPreview = 1;
  139. var hiliteMc;
  140. var loliteMc;
  141. Links = {};
  142. Tardis.sideMenu.EB.addListener(this);
  143. stop();
  144. onReady();
  145. this.onUnload = function()
  146. {
  147.    removeLinkListener();
  148.    this.onUnload = null;
  149. };
  150.